home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_03_02 / 3n02045a < prev    next >
Text File  |  1991-12-15  |  2KB  |  40 lines

  1.  
  2. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-Begin Listing 5-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  3. /*****************************************************/
  4. /* cursor.c                                          */
  5. /*  -- Routine to change the cursor even if a dialog */
  6. /*     box is present.                               */
  7. /*****************************************************/
  8.  
  9. VOID
  10. MySetCursor(HWND hwnd, WORD wm, WORD wmp, DWORD lwmp,
  11.   HCURSOR hcsr)
  12. /*****************************************************/
  13. /* -- Handle the WM_SETCURSOR message.               */
  14. /* -- hwnd  : Window receiving message.              */
  15. /* -- wm    : Message number.                        */
  16. /* -- wmp   : Word sized message parameter.          */
  17. /* -- lwmp  : Long word sized message parameter.     */
  18. /* -- hcsr  : Cursor to display.  Use NULL for       */
  19. /*            default.                               */
  20. /*****************************************************/
  21.     {
  22.     if (hcsr == hcsrNull)
  23.         {
  24.         DefWindowProc(hwnd, wm, wmp, lwmp);
  25.         }
  26.     else
  27.         {
  28.         /* Don't prevent DefWindowProc() form */
  29.         /* performing its hand in the kludge to make */
  30.         /* this application the active one! */
  31.         if (HIWORD(lwmp) == WM_LBUTTONDOWN &&
  32.           LOWORD(lwmp) == HTERROR)
  33.             DefWindowProc(hwnd, wm, wmp, lwmp);
  34.  
  35.         SetCursor(hcsr);
  36.         }
  37.     }
  38. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-End   Listing 5-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  39.  
  40.